Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid missing translation on batch confirmation #7455

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because bug fix.

When we render FilterDataType in the datagrid we only use form_widget, so the label is not needed.
When we render it in the batch confirmation page we render everything in display none, so the label are translated.
This PR solve this.

This solve half of the issue #4069, I don't know if we want to do more for this issue.
In order to use HiddenType in the batch confirmation we need to change

foreach ($this->getFilters() as $filter) {
    [$type, $options] = $filter->getRenderSettings();

    $this->formBuilder->add($filter->getFormName(), $type, $options);
}

to

foreach ($this->getFilters() as $filter) {
    $this->formBuilder->add($filter->getFormName(), HiddenType::class);
}

This means we need a different method to get the Form, and to get an HiddenForm.
Do we want to add a method to the datagridInterface just for this ?

Changelog

### Fixed
- Missing translation on batch confirmation page.

@VincentLanglet VincentLanglet added this to the 4.0 milestone Aug 28, 2021
@VincentLanglet VincentLanglet requested a review from a team August 28, 2021 16:28
@VincentLanglet
Copy link
Member Author

@core23 Do you think it's enough to close the issue ?
I'm not sure it's worth to add a method to the interface to have a form with hidden type, and I don't see other solution.

@core23
Copy link
Member

core23 commented Aug 28, 2021

I think we need some more work to fix the issue, but your PR will remove some of the problems.

I'm not sure if you can change every form element to a HiddenType without any problem.

@VincentLanglet VincentLanglet merged commit 0346f4b into sonata-project:4.x Aug 30, 2021
@VincentLanglet VincentLanglet deleted the batchConfirmation branch August 30, 2021 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants